local PanelList
local function AddItem( title, data )

	local Panel = vgui.Create( "Panel", PanelList )
	
	local rbutton = vgui.Create( "RadioButton", Panel )
			rbutton:SetText( title )
			rbutton:SetPos( 5, 0 )
			rbutton:SetSize( 205 , 15)
			rbutton:SetActionFunction(sometest)
			rbutton.data = data
			
		
	Panel:SetTall( 30 )
		
	return Panel

end

function dermaPopup()
	local w = 800
	local h = 600
	local window = vgui.Create( "DFrame" )
	window:SetSize( w, h )
	window:Center()
	window:SetTitle( "Advert Configuration" )
	window:SetVisible( true )
	window:MakePopup()
	
	
	--[[local lblTitle = vgui.Create( "DLabel", window)
		lblTitle:SetPos(15, 30)
		lblTitle:SetText( "Advert Type" )
		
	local lblTitle = vgui.Create( "DLabel", window)
		lblTitle:SetPos(230, 30)
		lblTitle:SetText( "Text" )
		
	local lblTitle = vgui.Create( "DLabel", window)
		lblTitle:SetPos(555, 30)
		lblTitle:SetText( "Options" )]]
		
	
		PanelList = vgui.Create( "DPanelList", window )
		PanelList:EnableVerticalScrollbar()
		PanelList:EnableHorizontal( false )
		PanelList:SetSize( w - 650, h - 100 )
		PanelList:SetPos( 10, 50 )	
		
	
	local Panel = AddItem("Arnold", "WHO ARE YOU")
		PanelList:AddItem(Panel)
	local Panel = AddItem("Tomato", "EAT ME")
		PanelList:AddItem(Panel)
	
	PanelList:PerformLayout()
	
end

function someclicktest()
	print("YOU CLICKED THE BUTTON!")
end

concommand.Add( "mydermatest2", dermaPopup )


function KeyPressed (P, key)
	Msg (P:GetName().." pressed "..key.."\n")
end

hook.Add( "KeyPress", "KeyPressedHook", KeyPressed ) 

function sometest(btn)
	print(btn.data)
end